# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=rizin-cutter
pkgver=2.3.2
pkgrel=1
pkgdesc="Reverse Engineering Platform powered by rizin"
url="https://cutter.re"
arch="all !armhf" # syntax-highlighting not available
license="GPL-3.0-only"
depends="rizin"
makedepends="
	cmake
	graphviz-dev
	python3-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	rizin-dev
	samurai
	syntax-highlighting5-dev
	"
subpackages="$pkgname-dev"
_translations_commit=974298653ba71b958e1b6c83f6011f5fefff6236
source="https://github.com/rizinorg/cutter/releases/download/v$pkgver/Cutter-v$pkgver-src.tar.gz"
builddir="$srcdir/Cutter-v$pkgver"
options="!check" # upstream does not provide a testsuite

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCUTTER_USE_BUNDLED_RIZIN=OFF \
		-DCUTTER_USE_ADDITIONAL_RIZIN_PATHS=OFF \
		-DCUTTER_ENABLE_GRAPHVIZ=ON \
		-DCUTTER_ENABLE_PYTHON=ON

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
65ca98f6618b1e60efa25d33bb4f3ef6b36dfd8496cf1f40c6a6b9744df3c2f77673d1d3cc1142c1b3b064abd0698ca07a20c5e4009ba5f6b05fc7f7501a4435  Cutter-v2.3.2-src.tar.gz
"
